Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

262
Vistas
Why do I get the error 'Invalid interaction application command' when I use this Slash command in discord.js?

When I try do use this slash command it says 'Invalid interaction application command'. How do I fix this? I can show more code if needed.

const Command = require('../structures/command.js');
const config = require('../data/config.json');
const { MessageEmbed } = require('discord.js');
const Discord = require('discord.js');

module.exports = new Command({
    name: "ping",
    description: "Shows the ping of the bot.",
    type: "BOTH",
    slashCommandOptions: [],
    permission: "ADMINISTRATOR",

    async run(message, args, client) {
        if (message.author.id === config.dev) {
            // const pingEmbed = new MessageEmbed()
            //     .setTitle(`Bot Ping: ${client.ws.ping} ms`)
            //     .setAuthor('System')
            //     // .setFooter(`${client.ws.ping} ms`)
            //     .setColor('5FA6E0')

            const m = await message.reply(`Bot Ping: ${client.ws.ping} ms`);
            const msg = message instanceof Discord.CommandInteraction ? await message.fetchReply() : m;
            msg.edit(`Ping: ${client.ws.ping} ms\nMessage Ping: ${msg.createdTimestamp - message.createdTimestamp} ms`);
        } else {
            message.reply(`Must be a developer to use the command [${this.name}]`);
        }
    }

});
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda